#pragma once

#include <QString>
#include <QImage>

class ImportModule
{
public:
    virtual ~ImportModule() {}

    // returns the import scheme, e. g. "disk" for a disk mount import module, or "gphoto2" for a gphoto2 import module
    virtual QString scheme() = 0;

    // returns a description of the import module
    virtual QString description() = 0;

    // detect items from the specified source url and initialize the import module
    virtual bool initialize(QString url) = 0;

    // returns the number of items in the specified source
    virtual int count() = 0;

    // returns the title of item i
    virtual QString title(int i) = 0;

    // returns a thumbnail preview of item i (if available)
    virtual QPixmap thumbnail(int i, QSize size) = 0;

    // copy item i to the specified path. returns the new filename, or an null-string if the import failed
    virtual bool import(int i, QString path) = 0;

    // delete item i from the source medium
    virtual bool remove(int i) = 0;

    // eject source medium
    virtual bool eject() = 0;

    // reset the import module state
    virtual void clear() = 0;
};
